<template>
  <view>
    <biaotou title="经办人员信息"></biaotou>
    <inputForm v-model="form" ref="form" :list="list"></inputForm>
  </view>
</template>

<script>
import Biaotou from "./biaotou.vue";
import {selectByDepartIdSimplification} from "../../../api/lupeiwenshu";
import inputForm from "../../../components/inputForm.vue";

export default {
  components: {Biaotou, inputForm},
  data() {
    return {
      poples: [],
      form: {
        officerIdList: [],
        recorderIds: ''
      },
      list: [
        {
          label: "经办人：",
          prop: "officerIdList",
          type: "multiple",
          props: {
            label: "name",
            value: "id"
          },
          dicData: []
        },
        {
          label: "记录人：",
          prop: "recorderIds",
          type: "select",
          props: {
            label: "name",
            value: "id"
          },
          dicData: []
        }
      ]
    };
  },
  methods: {
    async initSelectJson() {
      this.poples =
          this.list.find(item => item.label === '经办人：').dicData =
              this.list.find(item => item.label === '记录人：').dicData =
                  (await selectByDepartIdSimplification()).data;
    },
  },
  mounted() {
    this.initSelectJson();
  },

};
</script>
